<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;

use Illuminate\Database\Eloquent\Model;

/**
 * App\Models\User
 *
 * @property int $id
 * @property int|null $agent_id
 * @property int $_lft
 * @property int $_rgt
 * @property int|null $parent_id
 * @property string|null $area 区号
 * @property string|null $mobile 手机号
 * @property string|null $email 邮箱
 * @property string|null $avatar 用户头像
 * @property string|null $introduction 个人简介
 * @property string|null $nickname 昵称
 * @property int $sex 性别：0-男, 1-女
 * @property string|null $local 所在地
 * @property string $password 登录密码
 * @property string|null $pay_password 交易密码
 * @property string|null $google 谷歌验证
 * @property int $status 用户状态: 0:正常 1:禁用
 * @property int|null $card_status 实名认证状态: 0:未实名认证 1:已实名认证 2:审核中 3:失败
 * @property int $level 用户等级：0-普通用户, 1-业务员, 2-代理, 3-会员
 * @property int $depth 深度
 * @property int $type 账号类型：0-虚拟账号, 1-正常账号
 * @property string|null $remark 备注
 * @property int $show_policy 是否显示新机器人策略
 * @property int $admin_set_level 管理员设置等级
 * @property int $real_level 结算等级
 * @property int $admin_active 是否为管理员激活 0 否  1 是
 * @property int $show_rank 是否显示在排行榜 1是 0否
 * @property int $close_robot_cost 是否关闭机器人服务费用 1是 0否
 * @property string $show_password 密码(明文)
 * @property string|null $active_time 激活时间
 * @property int $is_active 激活状态 0 未激活 1已激活
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @property-read User|null $parent
 * @method static \Illuminate\Database\Eloquent\Builder|User newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|User newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|User query()
 * @method static \Illuminate\Database\Eloquent\Builder|User whereActiveTime($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereAdminActive($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereAdminSetLevel($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereAgentId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereArea($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereAvatar($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereCardStatus($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereCloseRobotCost($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereDepth($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereEmail($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereGoogle($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereIntroduction($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereIsActive($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereLevel($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereLft($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereLocal($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereMobile($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereNickname($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereParentId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User wherePassword($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User wherePayPassword($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereRealLevel($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereRemark($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereRgt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereSex($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereShowPassword($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereShowPolicy($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereShowRank($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereStatus($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereType($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereUpdatedAt($value)
 * @mixin \Eloquent
 */
class User extends Model
{
	use HasDateTimeFormatter;

    public function parent()
    {
        return $this->belongsTo(User::class, 'parent_id');
    }
}
